package org.ucas.faker.web.exceptions;

import org.springframework.http.HttpStatus;

/**
 * 权限禁止类异常
 * @author suemi
 */
public class ForbiddenException extends RestException {

  public static final ForbiddenException DEFAULT =
      new ForbiddenException(ErrCode.FORBIDDEN);

  public static final ForbiddenException DISABLED_ACCOUNT =
      new ForbiddenException(ErrCode.DISABLED_ACCOUNT);

  public static final ForbiddenException WRONG_TOKEN =
      new ForbiddenException(ErrCode.WRONG_TOKEN);

  public static final ForbiddenException FORBIDDEN =
      new ForbiddenException(ErrCode.FORBIDDEN);


  public static final ForbiddenException UNPRIVILEGED =
      new ForbiddenException(ErrCode.UNPRIVILEGED);

  public static final ForbiddenException WRONG_STATUS =
      new ForbiddenException(ErrCode.WRONG_STATUS);

  private ForbiddenException(ErrCode errCode) {
    super(errCode);
  }


  public static ForbiddenException of(String msg) {
    return new ForbiddenException(new ErrCode(
        HttpStatus.FORBIDDEN, msg));
  }
}

